<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/css/t/main.css" />
<link rel="stylesheet" href="${staticServer}/css/t/page.css" />
<link rel="stylesheet" href="${staticServer}/css/t/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/t/ask.css" />
<script src="${staticServer}/js/t/jquery.js"></script>
<script src="${staticServer}/js/t/pageset.js"></script>
<script src="${staticServer}/js/t/infopad.js"></script>
<script src="${staticServer}/js/t/datepicker.js"></script>
<script src="${staticServer}/js/t/tips.js"></script>
<script>

function starquery(type)
{
	if(type==0)
	{
		var sp_name = $( '#sp_name' ).val();
		var sp_code = $( '#sp_code' ).val();
		var sp_user = $( '#sp_user' ).val();
		var sp_ask = $( '#sp_ask' ).val();
		
		var params = [];
		if(!empty(sp_name)) params.push( "sp_name=" + sp_name );
		if(!empty(sp_code)) params.push( "sp_code=" + sp_code );
		if(!empty(sp_user)) params.push( "sp_user=" + sp_user );
		if(!empty(sp_ask)) params.push( "sp_ask=" + sp_ask );
	
		location.href = "?" + params.join("&");
	}
	else
	{
		location.href = "?";
	}
}

$(function(){
	$("#sp_ask").val("<#if spread??>${spread.spask}</#if>");
});
</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>问卷</li>
			<li>&gt;</li>
			<li class="current">问卷推广链接</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<div class="fieldset_container">
			<fieldset>
				<legend>查询条件</legend>
				<ul>
					<li><label>推广名称：</label>
						<input type="text" id="sp_name" size="15" placeholder="推广链接的名称" value="" />
					</li>
					<li><label>推广代码：</label>
						<input type="text" id="sp_code" size="15" placeholder="推广链接代码" value="" />
					</li>
					<li><label>推广人：</label>
						<input type="text" id="sp_user" size="15" placeholder="推广人姓名" value="" />
					</li>
					<li><label>问卷名称：</label>
						<select id="sp_ask">
						<#if askList??>
							<option value="">请选择</option>
							<#list askList as list>
								<option value="${list.keyname}">${list.topic}</option>
							</#list>
						</#if>
						</select>
					</li>
					<li class="controlbar">
						<input type="button" value=" 查 询 " onclick="starquery(0)" /> 
						<input type="button" value=" 重 置 " onclick="starquery(1)" />
					</li>
				</ul>
			</fieldset>
		</div>
		<table>
			<tr class="fields">
				<th>问卷名称</th>
				<th>推广名称</th>
				<th>推广人</th>
				<th>渠道来源</th>
				<th>推广代码</th>
				<th>更新日期</th>
				<th>操作</th>
			</tr>
		<#if list??>
			<#list list as list>
			<tr>
				<td><span class="stress">${list.topic}</span></td>
				<td><span class="quote">${list.name}</span></td>
				<td align="center" title="${list.job}">${list.nickname}</td>
				<td align="center">${list.sourcens}</td>
				<td align="center" title="点击打开该问卷页面">
					<#if list.ask == "zice">
						<a target="_blank" href="http://www.taleu.com/zice.html?sp=${list.spcode}">${list.spcode}</a>
					<#elseif list.ask == "wenjuan">
						<a target="_blank" href="http://www.taleu.com/wenjuan.html?sp=${list.spcode}">${list.spcode}</a>
					<#else>
					<a target="_blank" href="http://t.jingsiedu.com/t.php?sp=${list.spcode}">${list.spcode}</a>
					</#if>
				</td>
				<td align="center">
					${list.modedate}
				</td>
				<td align="center" title="修改推广链接信息">
					<a href="${contextPath}/admin/spread_add.htm?id=${list.id}">修改 </a>
				</td>
			</tr>
			</#list>
		</#if>
		</table>
	</div>
	<div id="pager">
		<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				<#if currpage==1 >
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${currpage-1}&sp_ask=${spread.spask}">上一页</a></li>
					</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${index_up}&sp_ask=${spread.spask}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${index_up}&sp_ask=${spread.spask}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${pagetotal}&sp_ask=${spread.spask}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=1&sp_ask=${spread.spask}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${index_up}&sp_ask=${spread.spask}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${pagetotal}&sp_ask=${spread.spask}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=1&sp_ask=${spread.spask}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${index_up}&sp_ask=${spread.spask}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/admin/ask_spread_list.htm?currPage=${currpage+1}&sp_ask=${spread.spask}">下一页</a></li>
		</#if>
		<li class="pageinfo">共${page.total}条记录</li>
		</#if>
		</ul>
	</div>
	<div class="emptyline"></div>
</body>
</html>